package com.dhr.sarcosuchus.assemble.security.service;

import com.dhr.sarcosuchus.assemble.security.dao.UserDao;
import com.dhr.sarcosuchus.assemble.security.pojo.User;
import com.dhr.sarcosuchus.daobase.mybatis.interceptor.PageInterceptor;
import com.dhr.sarcosuchus.daobase.pojo.Page;
import com.dhr.sarcosuchus.daobase.util.ConstantValue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {


    @Autowired
    private UserDao userDao;


    public boolean addUser(User user) {
        return userDao.addUser(user) == ConstantValue.FUNCTION_RETURN_NUMBER_1;
    }

    public List<User> getUserListPage(Page page, User user) {
        PageInterceptor.startPage(page);
        return userDao.getUserListPage(user);
    }

}
